#from __future__ import *

def jc(shu):
    ans = 1
    for i in range(1, shu + 1):
        ans *= i
    return ans


num = 0
a = int(input())
for i in range(1, a + 1):
    num += jc(i)
print(num, end = "")
